package Blog0;

class Person12 {
    private String name;
    private int age;
    public Person12() {
        System.out.println("我是构造方法");
    }

    {
        System.out.println("我是构造代码块又叫 实例化代码块");
    }
    static {
        System.out.println("我是静态代码块");
    }
}


class Person13 {

    static {
        count = 99;
        System.out.println("静态代码——————");
    }

    private static int count = 0;

    public void func() {
        System.out.println("count:"+count);
    }

}


class Person {
    private String name;
    private int age;

    public void eat() {
        System.out.println("吃饭了吗");
    }

    public void test() {
        System.out.println("这是一次测试");
    }

}
public class Blog03 {
    public static void main(String[] args) {
        Person person = new Person();
        person.eat();
        person.test();
        System.out.println("下面的是使用匿名对象调用:");
        System.out.println("***********************");
        new Person().eat();
        new Person().test();
    }



    public static void main2(String[] args) {
        Person13 person = new Person13();
        person.func();
    }

   public static void main1(String[] args) {
       Person12 person =new  Person12();
       System.out.println("*********************");
       Person12 person2 = new Person12();
   }
}
